/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.monVehicule.dao.ajouter;

import fr.monVehicule.dao.HibernateUtil;
import org.hibernate.Criteria;
import org.hibernate.Session;

/**
 *
 * @author David
 */
public abstract class DAO<T> {

    protected Session session = null;
    private Class<T> t;
    public DAO(Class<T> clazz) {
        session = HibernateUtil.getSessionFactory().openSession();
        t = clazz;
    }
    
    protected Criteria createCriteria(){
        return session.createCriteria(t);
    }
}
